<h1>Temas</h1>

      <ul>
    <?php foreach ($tema_list as $tema): ?>
    	<li><a href="<?php echo url_for('tema/show?cd_tema='.$tema->getCdTema()) ?>"><?php echo $tema->getName() ?> <small>(<?php echo $tema->countTemasPorProposicao() ?>)</small></a>
		  <ul><?php foreach ($tema_filho_list as $tema_filho): ?>
		        <?php if ($tema_filho->getCdTemaPai() <> $tema->getCdTema()) :
		    	  continue;
		        endif; ?>
		  	    <li><a href="<?php echo url_for('tema/show?cd_tema='.$tema_filho->getCdTema()) ?>"><?php echo $tema_filho->getName() ?> <small>(<?php echo $tema_filho->countTemasPorProposicao() ?>)</small></a>
			      <ul><?php foreach ($tema_neto_list as $tema_neto): ?>
				        <?php if ($tema_neto->getCdTemaPai() <> $tema_filho->getCdTema()) :
				      	  continue;
				        endif; ?>
				  	  <li><a href="<?php echo url_for('tema/show?cd_tema='.$tema_neto->getCdTema()) ?>"><?php echo $tema_neto->getName() ?> <small>(<?php echo $tema_neto->countTemasPorProposicao() ?>)</small></a></li>
				    <?php endforeach; ?>
				  </ul>
			    </li>
			  <?php endforeach; ?>
			</ul>
		</li>
    <?php endforeach; ?>
      </ul>

<?php if ($sf_user->getAttribute('gerente',null,'usr')) : ?>
<hr />
	<p><?php include_partial('form', array('form' => $form)) ?>
<?php endif; ?>

